package com.derbysoft.dswitch.adapter.ihg.common.domain;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import java.util.ArrayList;
import java.util.List;

@Entity
public class ReservationLog extends Log {

    private String ersp;

    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "reservationLog")
    private List<ReservationDetail> reservationDetails;

    public String getErsp() {
        return ersp;
    }

    public void setErsp(String ersp) {
        this.ersp = ersp;
    }

    public List<ReservationDetail> getReservationDetails() {
        if (reservationDetails == null) {
            return new ArrayList<ReservationDetail>();
        }
        return reservationDetails;
    }

    public void setReservationDetails(List<ReservationDetail> reservationDetails) {
        this.reservationDetails = reservationDetails;
    }
}
